{% extends "base.html" %}
{% block head %}
    {{ super() }}
    <link rel="stylesheet" href="{{ url_for('static',filename = 'css/book_search.css') }}">
{% endblock %}
{% block content %}
    {{ super() }}
    <div class="wrap">
        <div class="search-container" data-l1="2">
            <div class="search-wrap cf">
                 <form action="#" method="get" class="sidebar-form">
                <input name="q" type="text" placeholder="ISBN、图书名称" id="s-box" value="{{ books.keyword }}" autocomplete="off">
                <input class="search-btn" type="submit"
                   id="search-btn"
                   href="javascript:"
                   data-eid="qd_S01" value="搜索">
                 </form>
            </div>
        </div>
        <div class="result-wrap box-center cf">
            <div class="main-content-wrap fl">
                <div style="margin-top:20px;" class="row flex-vertical-center">
                    <div class="col-md-6">
            <span class="sub-title">搜索 <span class="space highlight"
                                             id="keyword">{{ books.keyword }}</span>的结果</span>
                    </div>
                    <div class="col-md-3 col-md-offset-3">
            <span class="sub-title"> 共 <span class="space"
                                             id="total">{{ books.total }}</span> 条记录</span>
                    </div>
                </div>
                <hr>
                <div class="book-img-text">
                    <ul>
                        {% for book in books.books %}
                            <li class="res-book-item" data-bid="1005394024" data-rid="1">
                                <div class="book-img-box">
                                    <a href="{{ url_for('web.book_detail', isbn=book.isbn) }}" target="_blank"
                                       data-eid="qd_S04"
                                       data-algrid="0.0.0" data-bid="1005394024"><img src="{{ book.image }}"></a>
                                </div>
                                <div class="book-mid-info">

                                    <h4><a href="{{ url_for('web.book_detail', isbn=book.isbn) }}" target="_blank"
                                           data-eid="qd_S05"
                                           data-bid="1005394024" data-algrid="0.0.0">{{ book.title }}</a></h4>
                                    <p class="author">
                                        <img src="{{ book.image }}">
                                        <a class="name" href="{{ url_for('web.book_detail', isbn=book.isbn) }}"
                                           target="_blank"/><span>{{ book.intro }}</span>
                                    </p>
                                    <p class="intro">
                                        {{ book.summary | default('', true) }}
                                    </p>
                                    <p class="update">
                                        <a href="#" target="_blank"
                                           data-eid="qd_S08" data-bid="1005394024">最新消息 xxx赠送</a>
                                        <em>·</em><span>22小时前有人索要/赠送</span>
                                    </p>
                                </div>
                                <div class="book-right-info">
                                    <div class="total">
                                        <p><span> 0</span>人需要</p>
                                        <p><span> 0</span>人赠送</p>
                                    </div>
                                    <p class="btn">
                                        <a class="red-btn" href="https://book.qidian.com/info/1005394024"
                                           data-eid="qd_S02"
                                           target="_blank">赠送书籍</a>
                                        <a class="blue-btn add-book" href="javascript:" data-eid="qd_S03"
                                           data-bookid="1005394024"
                                           data-bid="1005394024">索要书籍</a>
                                    </p>
                                </div>
                            </li>

                        {% endfor %}


                    </ul>
                </div>


            </div>
            <div class="right-side-wrap fr" data-l1="4">
                <div class="other-rec-wrap">

                    <h3 class="lang">我猜你还喜欢</h3>
                    <ul>
                        {% for book in books.books %}
                            <li data-rid="1">
                                <div class="img-box">
                                    <a href="https://book.qidian.com/info/3609887" data-algrid="180.13.3.1"
                                       target="_blank"><img src="{{ book.image }}"></a></div>
                                <div class="book-info">
                                    <h4><a href="https://book.qidian.com/info/3609887" target="_blank" data-eid="qd_S28"
                                           data-bid="3609887" data-algrid="180.13.3.1">{{ book.title }}</a></h4>
                                    <p class="author"><img src="{{ book.image }}"><a
                                            href="https://my.qidian.com/author/3137889" target="_blank"
                                            data-eid="qd_S29">{{ book.author }}</a></p>
                                    <p class="intro">63%的用户读过</p>
                                </div>
                            </li>
                            <hr>
                        {% endfor %}
                    </ul>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="flex-hor-center">
                <ul class="pagination" id="pagination"></ul>
            </div>
        </div>
    </div>

{% endblock %}
{% block scripts %}
    {{ super() }}
    <script src="{{ url_for('static', filename='3rd/jquery.twbsPagination.min.js') }}"></script>
    <script src="{{ url_for('static', filename="js/util.js") }}"></script>
    <script src="{{ url_for('static', filename='js/search_result.js') }}"></script>
{% endblock %}
